package Homework13;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class task2 {
    public static void main(String[] args) throws IOException{
        BufferedReader bufferedReader=new BufferedReader(new FileReader("D:pan.txt"));
        ArrayList<String>arrayList=new ArrayList<String>();
        String line=null;
        Random random=new Random();
       while ((line=bufferedReader.readLine())!=null){
           arrayList.add(line);

       }
       int a=random.nextInt(arrayList.size());
       String s=arrayList.get(a);
       System.out.println(s);
    }
}
